package com.im.controller;



import com.im.entity.ImGroup;
import com.im.entity.vo.GroupVO;
import com.im.service.IImGroupService;
import com.im.web.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author im
 * @since 2025-01-30
 */
@Tag(name = "群组模块")
@RestController
@RequestMapping("/link-IM/im-group")
public class ImGroupController {
    @Autowired
    private IImGroupService groupService;
    @PostMapping("/create")
    @Operation(summary = "创建群聊", description = "创建群聊")
    public Result<GroupVO> createGroup(@RequestBody GroupVO groupvo){
        return Result.success(groupService.createGroup(groupvo));
    }
    @PostMapping("/modify")
    @Operation(summary = "修改群聊信息", description = "修改群聊信息")
    public Result<GroupVO> modifyGroup(@Valid @RequestBody GroupVO vo) {
        return Result.success(groupService.modifyGroup(vo));
    }


}

